package com.nbsaas.boot.system.rest.convert;

import com.nbsaas.boot.system.data.entity.RoleMenu;
import com.nbsaas.boot.system.api.domain.simple.RoleMenuSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 角色功能-列表对象转换器
*/

public class RoleMenuSimpleConvert implements Converter<RoleMenuSimple, RoleMenu> {




@Override
public RoleMenuSimple convert(RoleMenu source) {
    RoleMenuSimple result = new RoleMenuSimple();


               try {
                   if(source.getRole()!=null){
                       result.setRole(source.getRole().getId());
                   }
                } catch (Exception ignored) { }

                result.setId(source.getId());

               try {
                   if(source.getMenu()!=null){
                       result.setMenu(source.getMenu().getId());
                   }
                } catch (Exception ignored) { }

                result.setAddDate(source.getAddDate());
                result.setLastDate(source.getLastDate());


    return result;
}

}